package com.hddf.project.impl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import com.hddf.project.base.BaseDaoImpl;
import com.hddf.project.dao.ProjectDao;
import com.hddf.project.pojos.Project;
import com.hddf.project.pojos.ProjectApproval;
import com.hddf.project.pojos.ProjectCheck;
import com.hddf.project.pojos.ProjectDoc;
import com.hddf.project.pojos.ProjectImg;
import com.hddf.project.pojos.ProjectOther;
import com.hddf.project.pojos.ProjectTable;
import com.hddf.project.pojos.ProjectVideo;
import com.hddf.project.util.O;

//import com.hddf.project.pojos.CheckAnnotations;
@SuppressWarnings("unchecked")
public class ProjectDaoImpl extends BaseDaoImpl implements ProjectDao {

	/**
	 * 根据三级ID获取项目
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	@Override
	public List<Project> getProjectsByThirdCategory(Integer t_id, Integer startData, Integer lengthData, Session s)
			throws Exception {
		Query query = s.createQuery("from Project p where p.third_category_id=:temp order by p.id desc");
		query.setInteger("temp", t_id);
		if (null != lengthData && 0 != lengthData) {// 分页
			query.setFirstResult(startData);
			query.setMaxResults(lengthData);
		}
		List<Project> pList = query.list();
		return pList;
	}

	/**
	 * 根据一级分类ID获取项目
	 * 
	 * @param f_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<Project> getProjectsByFirstCategory(Integer f_id, Integer startData, Integer lengthData, Session s)
			throws Exception {
		Query query = s.createQuery("from Project p where p.first_category_id=:temp order by p.id desc");
		query.setInteger("temp", f_id);
		if (null != lengthData && 0 != lengthData) {// 分页
			query.setFirstResult(startData);
			query.setMaxResults(lengthData);
		}
		List<Project> pList = query.list();
		return pList;
	}

	/**
	 * 根据二级分类ID获取项目
	 * 
	 * @param f_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<Project> getProjectsBySecondCategory(Integer s_id, Integer startData, Integer lengthData, Session s)
			throws Exception {
		Query query = s.createQuery("from Project p where p.second_category_id=:temp order by p.id desc");
		query.setInteger("temp", s_id);
		if (null != lengthData && 0 != lengthData) {// 分页
			query.setFirstResult(startData);
			query.setMaxResults(lengthData);
		}
		List<Project> pList = query.list();
		return pList;
	}

	/**
	 * 根据三级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	@Override
	public Integer getProjectsCountByThirdCategory(Integer t_id, Session s) throws Exception {
		Query query = s.createQuery("select count(p.id) from Project p where p.third_category_id=:temp ");
		query.setInteger("temp", t_id);
		int result = 0;
		if (null != query.uniqueResult()) {
			result = Integer.parseInt(query.uniqueResult().toString());
		}
		return result;
	}

	/**
	 * 根据一级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	@Override
	public Integer getProjectsCountByFirstCategory(Integer f_id, Session s) throws Exception {
		Query query = s.createQuery("select count(p.id) from Project p where p.first_category_id=:temp ");
		query.setInteger("temp", f_id);
		int result = 0;
		if (null != query.uniqueResult()) {
			result = Integer.parseInt(query.uniqueResult().toString());
		}
		return result;
	}

	/**
	 * 根据二级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	@Override
	public Integer getProjectsCountBySecondCategory(Integer s_id, String plan, Session s) throws Exception {
		String hql = "select count(p.id) from Project p where p.second_category_id=:temp";
		if (O.ckSt(plan)) {
			hql += " and p.plan=:_plan";
		}
		Query query = s.createQuery(hql);
		query.setInteger("temp", s_id);
		if (O.ckSt(plan)) {
			query.setString("_plan", plan);
		}
		int result = 0;
		if (null != query.uniqueResult()) {
			result = Integer.parseInt(query.uniqueResult().toString());
		}
		return result;
	}

	/**
	 * 查询全部项目的数量
	 * 
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public Integer getAllProject(Session s) throws Exception {
		return super.getIntValue("select count(p.id) from Project p", s);
	}

	/**
	 * 根据二级分类ID获取项目
	 * 
	 * @param f_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<Project> getAllProjects(Integer startData, Integer lengthData, Session s) throws Exception {
		Query query = s.createQuery("from Project p order by p.id desc");
		if (null != lengthData && 0 != lengthData) {// 分页
			query.setFirstResult(startData);
			query.setMaxResults(lengthData);
		}
		return query.list();
	}

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectDoc> getDocsByProjectId(Integer p_id, Session s) throws Exception {
		Query query = s.createQuery("from ProjectDoc p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectImg> getImgsByProjectId(Integer p_id, Session s) throws Exception {
		Query query = s.createQuery("from ProjectImg p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectOther> getOtherByProjectId(Integer p_id, Session s) {
		Query query = s.createQuery("from ProjectOther p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectTable> getTablesByProjectId(Integer p_id, Session s) throws Exception {
		Query query = s.createQuery("from ProjectTable p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectApproval> getApprovalsByProjectId(Integer p_id, Session s) throws Exception {
		Query query = s.createQuery("from ProjectApproval p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据项目ID获取部门意见
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectCheck> getChecksByProjectId(Integer p_id, Session s) throws Exception {
		Query query = s.createQuery("from ProjectCheck p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据项目ID获取
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<ProjectVideo> getVideoByProjectId(Integer p_id, Session s) throws Exception {
		Query query = s.createQuery("from ProjectVideo p where p.projectId=:temp");
		query.setInteger("temp", p_id);
		return query.list();
	}

	/**
	 * 根据很多的查询条件查询符合结果的项目
	 * 
	 * @return
	 */
	@Override
	public List<Project> getProjectListByMoreConditions(Integer startData, Integer lengthData, Integer f_id,
			Integer s_id, Integer t_id, String projectName, String startTime, String endTime, String startFund,
			String endFund, String mgrDepart, String buildSide, String plan, List<String> area, Short ispass,
			Short comment, Short checkout, Session s) throws Exception {
		StringBuffer sb = new StringBuffer();
		sb.append("from Project p where 1 = 1 ");

		if (null != f_id && 0 != f_id) {
			sb.append(" and p.first_category_id=:fid");// fid
		}

		if (null != s_id && 0 != s_id) {
			sb.append(" and p.second_category_id=:sid");// sid
		}

		if (null != t_id && 0 != t_id) {
			sb.append(" and p.third_category_id=:tid");// tid
		}

		if (O.ckSt(projectName)) {
			sb.append(" and p.name like :pname");// pname
		}

		if (O.ckSt(startTime) && !O.ckSt(endTime)) {
			sb.append(" and p.impl_time >= :startTime ");
		} else if (!O.ckSt(startTime) && O.ckSt(endTime)) {
			sb.append(" and p.impl_time <= :endTime");
		} else if (O.ckSt(startTime) && O.ckSt(endTime)) {
			sb.append(" and p.impl_time between :startTime and :endTime ");
		}

		if (O.ckSt(startFund) && !O.ckSt(endFund)) {
			sb.append(" and p.fund >= :startFund ");
		} else if (!O.ckSt(startFund) && O.ckSt(endFund)) {
			sb.append(" and p.fund <= :endFund");
		} else if (O.ckSt(startFund) && O.ckSt(endFund)) {
			sb.append(" and p.fund between :startFund and :endFund ");
		}

		if (O.ckSt(mgrDepart)) {
			sb.append(" and p.mgr_depart like :mgrDepart");
		}

		if (O.ckSt(buildSide)) {
			sb.append(" and p.build_side like :buildSide");
		}

		if (O.ckSt(plan)) {
			sb.append(" and p.plan =:plan");
		}

		if (O.ckLt(area)) {
			switch (area.size()) {
			case 1:
				sb.append(" and p.area = :area");
				break;
			default:
				sb.append(" and p.area in (:area)");
				break;
			}
		}

		if (null != ispass && 0 != ispass) {
			sb.append(" and p.ispass =:ispass");
		}

		if (null != comment && 0 != comment) {
			sb.append(" and p.comment =:comment");
		}

		if (null != checkout && 0 != checkout) {
			sb.append(" and p.checkout =:checkout");
		}

		sb.append(" order by p.update_time desc,p.id desc");

		Query query = s.createQuery(sb.toString());

		if (null != f_id && 0 != f_id) {
			query.setInteger("fid", f_id);
		}

		if (null != s_id && 0 != s_id) {
			query.setInteger("sid", s_id);// sid
		}

		if (null != t_id && 0 != t_id) {
			query.setInteger("tid", t_id);// tid
		}

		if (O.ckSt(projectName)) {
			query.setString("pname", "%" + projectName + "%");
		}

		if (O.ckSt(startTime) && !O.ckSt(endTime)) {
			query.setString("startTime", startTime);
		} else if (!O.ckSt(startTime) && O.ckSt(endTime)) {
			query.setString("endTime", endTime);
		} else if (O.ckSt(startTime) && O.ckSt(endTime)) {
			query.setString("startTime", startTime);
			query.setString("endTime", endTime);
		}

		if (O.ckSt(startFund) && !O.ckSt(endFund)) {
			query.setString("startFund", startFund);
		} else if (!O.ckSt(startFund) && O.ckSt(endFund)) {
			query.setString("endFund", endFund);
		} else if (O.ckSt(startFund) && O.ckSt(endFund)) {
			query.setString("startFund", startFund);
			query.setString("endFund", endFund);
		}

		if (O.ckSt(mgrDepart)) {
			query.setString("mgrDepart", "%" + mgrDepart + "%");
		}

		if (O.ckSt(buildSide)) {
			query.setString("buildSide", "%" + buildSide + "%");
		}

		if (O.ckSt(plan)) {
			query.setString("plan", plan);
		}

		if (O.ckLt(area)) {
			switch (area.size()) {
			case 1:
				query.setString("area", area.get(0));
				break;
			default:
				query.setParameterList("area", area);
				break;
			}
		}

		if (null != ispass && 0 != ispass) {
			query.setInteger("ispass", ispass);
		}

		if (null != comment && 0 != comment) {
			query.setInteger("comment", comment);
		}

		if (null != checkout && 0 != checkout) {
			query.setInteger("checkout", checkout);
		}

		if (null != lengthData && 0 != lengthData) {// 分页
			query.setFirstResult(startData);
			query.setMaxResults(lengthData);
		}
		return query.list();
	}

	/**
	 * 根据二级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	@Override
	public Integer getProjectsCountByMoreConditions(Integer f_id, Integer s_id, Integer t_id, String projectName,
			String startTime, String endTime, String startFund, String endFund, String mgrDepart,
			String buildSide, String plan, List<String> area, Short ispass, Short comment, Short checkout,
			Session s) throws Exception {
		StringBuffer sb = new StringBuffer();
		sb.append("select count(p.id) from Project p where 1=1 ");

		if (null != f_id && 0 != f_id) {
			sb.append(" and p.first_category_id=:fid");// fid
		}

		if (null != s_id && 0 != s_id) {
			sb.append(" and p.second_category_id=:sid");// sid
		}

		if (null != t_id && 0 != t_id) {
			sb.append(" and p.third_category_id=:tid");// tid
		}

		if (O.ckSt(projectName)) {
			sb.append(" and p.name like :pname");// pname
		}

		if (O.ckSt(startTime) && !O.ckSt(endTime)) {
			sb.append(" and p.impl_time >=:startTime ");
		} else if (!O.ckSt(startTime) && O.ckSt(endTime)) {
			sb.append(" and p.impl_time <=:endTime");
		} else if (O.ckSt(startTime) && O.ckSt(endTime)) {
			sb.append(" and p.impl_time between :startTime and :endTime ");
		}

		if (O.ckSt(startFund) && !O.ckSt(endFund)) {
			sb.append(" and p.fund >=:startFund ");
		} else if (!O.ckSt(startFund) && O.ckSt(endFund)) {
			sb.append(" and p.fund <=:endFund");
		} else if (O.ckSt(startFund) && O.ckSt(endFund)) {
			sb.append(" and p.fund between :startFund and :endFund ");
		}

		if (O.ckSt(mgrDepart)) {
			sb.append(" and p.mgr_depart like :mgrDepart");
		}

		if (O.ckSt(buildSide)) {
			sb.append(" and p.build_side like :buildSide");
		}

		if (O.ckSt(plan)) {
			sb.append(" and p.plan =:plan");
		}

		if (O.ckLt(area)) {
			switch (area.size()) {
			case 1:
				sb.append(" and p.area = :area");
				break;
			default:
				sb.append(" and p.area in (:area)");
				break;
			}
		}

		if (null != ispass && 0 != ispass) {
			sb.append(" and p.ispass =:ispass");
		}
		if (null != comment && 0 != comment) {
			sb.append(" and p.comment =:comment");
		}
		if (null != checkout && 0 != checkout) {
			sb.append(" and p.checkout =:checkout");
		}

		sb.append(" order by p.update_time desc");

		Query query = s.createQuery(sb.toString());

		if (null != f_id && 0 != f_id) {
			query.setInteger("fid", f_id);
		}

		if (null != s_id && 0 != s_id) {
			query.setInteger("sid", s_id);// sid
		}

		if (null != t_id && 0 != t_id) {
			query.setInteger("tid", t_id);// tid
		}

		if (O.ckSt(projectName)) {
			query.setString("pname", "%" + projectName + "%");
		}

		if (O.ckSt(startTime) && !O.ckSt(endTime)) {
			query.setString("startTime", startTime);
		} else if (!O.ckSt(startTime) && O.ckSt(endTime)) {
			query.setString("endTime", endTime);
		} else if (O.ckSt(startTime) && O.ckSt(endTime)) {
			query.setString("startTime", startTime);
			query.setString("endTime", endTime);
		}

		if (O.ckSt(startFund) && !O.ckSt(endFund)) {
			sb.append(" and p.fund >=:startFund ");
			query.setString("startFund", startFund);
		} else if (!O.ckSt(startFund) && O.ckSt(endFund)) {
			query.setString("endFund", endFund);
		} else if (O.ckSt(startFund) && O.ckSt(endFund)) {
			query.setString("startFund", startFund);
			query.setString("endFund", endFund);
		}

		if (O.ckSt(mgrDepart)) {
			query.setString("mgrDepart", "%" + mgrDepart + "%");
		}

		if (O.ckSt(buildSide)) {
			query.setString("buildSide", "%" + buildSide + "%");
		}

		if (O.ckSt(plan)) {
			query.setString("plan", plan);
		}

		if (O.ckLt(area)) {
			switch (area.size()) {
			case 1:
				query.setString("area", area.get(0));
				break;
			default:
				query.setParameterList("area", area);
				break;
			}
		}

		if (null != ispass && 0 != ispass) {
			query.setInteger("ispass", ispass);
		}

		if (null != comment && 0 != comment) {
			query.setInteger("comment", comment);
		}
		if (null != checkout && 0 != checkout) {
			query.setInteger("checkout", checkout);
		}

		int result = 0;
		if (null != query.uniqueResult()) {
			result = Integer.parseInt(query.uniqueResult().toString());
		}
		return result;
	}

	/**
	 * 根据一级分类ID获取对应的项目数量
	 * 
	 * @param f_id
	 * @return
	 * @throws Exception
	 */
	@Override
	public Integer getProjectCountByCategoryFirst(Integer f_id, Session s) throws Exception {
		Query query = s.createQuery("select count(p.id) from Project p where p.first_category_id=:temp");
		query.setInteger("temp", f_id);
		int result = 0;
		if (null != query.uniqueResult()) {
			result = Integer.parseInt(query.uniqueResult().toString());
		}
		return result;
	}

	/**
	 * 根据名字和项目ID查询批件
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectApproval getApprovalByUploadName(Integer projectId, String uploadName, Session s)
			throws Exception {
		Query query = s
				.createQuery("from ProjectApproval p where p.projectId=:projectId and p.approvalName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectApproval> paList = query.list();
		ProjectApproval pa = new ProjectApproval();
		if (O.ckLt(paList)) {
			pa = paList.get(0);
		}
		return pa;
	}

	/**
	 * 根据名字和项目ID查询意见
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectCheck getCheckByUploadName(Integer projectId, String uploadName, Session s) throws Exception {
		Query query = s
				.createQuery("from ProjectCheck p where p.projectId=:projectId and p.checkName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectCheck> pcList = query.list();
		ProjectCheck pc = new ProjectCheck();
		if (O.ckLt(pcList)) {
			pc = pcList.get(0);
		}
		return pc;
	}

	/**
	 * 根据名字和项目ID查询文档
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectDoc getDocByUploadName(Integer projectId, String uploadName, Session s) throws Exception {
		Query query = s.createQuery("from ProjectDoc p where p.projectId=:projectId and p.docName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectDoc> pdList = query.list();
		ProjectDoc pd = new ProjectDoc();
		if (O.ckLt(pdList)) {
			pd = pdList.get(0);
		}
		return pd;
	}

	/**
	 * 根据名字和项目ID查询图片
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectImg getImgByUploadName(Integer projectId, String uploadName, Session s) throws Exception {
		Query query = s.createQuery("from ProjectImg p where p.projectId=:projectId and p.imgName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectImg> piList = query.list();
		ProjectImg pi = new ProjectImg();
		if (O.ckLt(piList)) {
			pi = piList.get(0);
		}
		return pi;
	}

	/**
	 * 根据名字和项目ID查询三表
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectTable getTableByUploadName(Integer projectId, String uploadName, Session s) throws Exception {
		Query query = s
				.createQuery("from ProjectTable p where p.projectId=:projectId and p.tableName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectTable> ptList = query.list();
		ProjectTable pt = new ProjectTable();
		if (O.ckLt(ptList)) {
			pt = ptList.get(0);
		}
		return pt;
	}

	/**
	 * 根据名字和项目ID查询三表
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectVideo getVideoByUploadName(Integer projectId, String uploadName, Session s) throws Exception {
		Query query = s
				.createQuery("from ProjectVideo p where p.projectId=:projectId and p.videoName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectVideo> pvList = query.list();
		ProjectVideo pt = new ProjectVideo();
		if (O.ckLt(pvList)) {
			pt = pvList.get(0);
		}
		return pt;
	}

	/**
	 * 根据名字和项目ID查询其他文件
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	@Override
	public ProjectOther getOtherByUploadName(Integer projectId, String uploadName, Session s) {
		Query query = s
				.createQuery("from ProjectOther p where p.projectId=:projectId and p.otherName=:uploadName ");
		query.setInteger("projectId", projectId);
		query.setString("uploadName", uploadName);
		List<ProjectOther> poList = query.list();
		ProjectOther po = null;
		if (O.ckLt(poList)) {
			po = poList.get(0);
		}
		return po;
	}

	// /**
	// * 查询是否有新更新的批示
	// *
	// * @param s
	// * @return
	// * @throws Exception
	// */
	// @SuppressWarnings("unchecked")
	// public List<CheckAnnotations> getUpdateNotation(Session s) throws
	// Exception {
	// Query query =
	// s.createQuery("from CheckAnnotations ca order by ca.id desc");
	// return (List<CheckAnnotations>) query.list();
	// }
	//
	// /**
	// * 根据项目ID查询是否存在更新
	// *
	// * @param projectId
	// * @param s
	// * @return
	// * @throws Exception
	// */
	// @SuppressWarnings("unchecked")
	// public CheckAnnotations getCheckAnnotationsByProjectId(Integer projectId,
	// Session s) throws Exception {
	// Query query =
	// s.createQuery("from CheckAnnotations ca where ca.projectId=:projectId");
	// query.setInteger("projectId", projectId);
	// List<CheckAnnotations> caList = query.list();
	// CheckAnnotations ca = new CheckAnnotations();
	// if (O.ckLt(caList)) {
	// ca = (CheckAnnotations) caList.get(0);
	// }
	// return ca;
	// }

	/**
	 * 根据计划查询项目，并按照一级、二级、三级类别正序排序
	 * 
	 * @param planId
	 * @param s
	 * @return
	 * @throws Exception
	 */

	@Override
	public List<Project> projectByPlanId(List<Integer> planIds, Session s) throws Exception {
		Query query = s.createQuery("from Project as p where p.id in (:planIds) "
				+ "order by p.first_category_id,p.second_category_id,p.third_category_id asc");
		query.setParameterList("planIds", planIds);
		List<Project> pList = query.list();
		return pList;
	}

	/**
	 * 根据项目名称查找项目实体
	 * 
	 * @param name
	 * @return
	 */
	@Override
	public Project project(String name, Session s) {
		Query query = s.createQuery("from Project as p where p.name=:pname");
		query.setString("pname", name);
		List<Project> pList = query.list();
		Project p = null;
		if (O.ckLt(pList)) {
			p = pList.get(0);
		}
		return p;
	}

	/**
	 * 获取项目类别为空的数据
	 * 
	 * @return
	 */
	@Override
	public List<Project> listProjectCategory(Session s) {
		return super.find("from Project where first_category_id is null or first_category_id='' order by id desc",
				s);
	}
}